<%--
  Created by IntelliJ IDEA.
  User: 92432
  Date: 2019/10/8
  Time: 18:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>保证金解冻审核列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css" />
    <script src="js/jquery.min.js"></script>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
    <!-- <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> -->
    <script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>

    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .page .pagination li{
            margin: 0;
            float: left;
        }
        .page .pagination li span{
            padding: 0;
            border: none;
        }
    </style>
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">保证金管理</a>
                <a>
                    <cite>保证金解冻审核</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">


                <div class="layui-card-body " style="padding-top: 16px;">
                    <form class="layui-form layui-col-space5" style="margin-bottom: 10px;" id="search" action="/margin/auditList" method="post">
<%--                    <form class="layui-form layui-col-space5" style="margin-bottom: 10px;" id="search">--%>

                        <div class="layui-input-inline layui-show-xs-block">
                            <input class="layui-input" placeholder="单据编号" name="bill_number" value="${keywords[0]}"></div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <input class="layui-input" placeholder="供应商名称" name="supplier_name" value="${keywords[1]}"></div>

                        <div class="layui-input-inline layui-show-xs-block">
                            <button class="layui-btn"  style="margin-top: 0;" >
                                <i class="layui-icon">&#xe615;</i>搜索</button>
                        </div>
                        <a href="/margin/auditList">
                            <div class="layui-input-inline layui-show-xs-block">
                                <button class="layui-btn"  style="margin-top: 0;" type="button">
                                    查看全部</button>
                            </div>
                        </a>
                    </form>
                    <c:if test="${(pageInfo.list)!= null && fn:length(pageInfo.list) > 0}">
                    <div class="layui-col-md12" style="margin-bottom: 10px;">
                        <div class="layui-card">

                            <!-- <div class="layui-card-body "> -->
                            <table class="layui-table gonggaotable">
                                <colgroup>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th>id</th>
                                        <th>单据编号</th>
                                        <th>供应商名称</th>
                                        <th>类型</th>
                                        <th>金额(元)</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${pageInfo.list}" var="margin">
                                    <tr>
                                        <td>${margin.id}</td>
                                        <td>${margin.purchase.bill_number}</td>
                                        <td>${margin.supplier.supplier_name}</td>
                                        <c:if test="${margin.marginType == 1}">
                                            <td>报价保证金</td>
                                        </c:if>
                                        <c:if test="${margin.marginType == 2}">
                                            <td>履约保证金</td>
                                        </c:if>

                                        <td>${margin.marginMoney}</td>
                                        <td class="td-manage">

                                            <a title="审批"  onclick="" href="view?marginId=${margin.id}&tag=2" >
                                                <i class="layui-icon">&#xe6b2;</i>审批&thinsp; &thinsp; &thinsp;
                                            </a>
                                        </td>
                                    </tr>
                                </c:forEach>

                                </tbody>
                            </table>
                            <!-- </div> -->
                        </div>
                    </div>
                    <!-- 列表结束 -->
                    <footer class="page">
                        <div class="row">

                            <!--点击分页-->
                            <div class="col-md-12">
                                <nav aria-label="Page navigation">
                                    <ul class="pagination" style="margin-bottom: 0;margin-top: 10px;">

                                        <li><a href="${pageContext.request.contextPath}/margin/auditList?pn=1&bill_number=${keywords[0]}&supplier_name=${keywords[1]}">首页</a></li>

                                        <!--上一页-->
                                        <li>
                                            <c:if test="${pageInfo.hasPreviousPage}">
                                                <a href="${pageContext.request.contextPath}/margin/auditList?pn=${pageInfo.pageNum-1}&bill_number=${keywords[0]}&supplier_name=${keywords[1]}" aria-label="Previous">
                                                    <span aria-hidden="true">«</span>
                                                </a>
                                            </c:if>
                                        </li>

                                        <!--循环遍历连续显示的页面，若是当前页就高亮显示，并且没有链接-->
                                        <c:forEach items="${pageInfo.navigatepageNums}" var="page_num">
                                            <c:if test="${page_num == pageInfo.pageNum}">
                                                <li class="active"><a href="#">${page_num}</a></li>
                                            </c:if>
                                            <c:if test="${page_num != pageInfo.pageNum}">
                                                <li><a href="${pageContext.request.contextPath}/margin/auditList?pn=${page_num}&bill_number=${keywords[0]}&supplier_name=${keywords[1]}">${page_num}</a></li>
                                            </c:if>
                                        </c:forEach>

                                        <!--下一页-->
                                        <li>
                                            <c:if test="${pageInfo.hasNextPage}">
                                                <a href="${pageContext.request.contextPath}/margin/auditList?pn=${pageInfo.pageNum+1}&bill_number=${keywords[0]}&supplier_name=${keywords[1]}"
                                                   aria-label="Next">
                                                    <span aria-hidden="true">»</span>
                                                </a>
                                            </c:if>
                                        </li>

                                        <li><a href="${pageContext.request.contextPath}/margin/auditList?pn=${pageInfo.pages}&bill_number=${keywords[0]}&supplier_name=${keywords[1]}">尾页</a></li>
                                    </ul>
                                </nav>
                            </div>
                            <!--文字信息-->
                            <div class="col-md-12">
                                当前第 ${pageInfo.pageNum} 页.总共 ${pageInfo.pages} 页.一共 ${pageInfo.total} 条记录
                            </div>

                        </div>
                    </footer>
                    </c:if>
                    <c:if test="${(pageInfo.list) == null || fn:length(pageInfo.list) == 0}">
                        <p style="color: #3b3b3b;text-align:  center;padding: 100px 0;font-size: 16px;">查无此订单信息！</p>
                    </c:if>
                </div>

            </div>
        </div>
    </div>
</div>
<%--<script>--%>
<%--    function search() {--%>
<%--        $.ajax({--%>
<%--            type:"post",--%>
<%--            url:"/margin/auditListaaa",--%>
<%--            data:$('#search').serialize(),--%>
<%--            dataType:"json",--%>
<%--            success:function (data) {--%>
<%--                console.log("AAAAAA");--%>
<%--                if (data.length > 0){--%>
<%--                    // window.location.href="auditList";--%>
<%--                }else{--%>
<%--                    alert('查无记录，请重新输入');--%>
<%--                    window.location.reload();--%>
<%--                }--%>

<%--            },--%>
<%--            error: function(data) {--%>
<%--              console.log("bbbb");--%>
<%--              console.log(data);--%>
<%--            }--%>
<%--        });--%>
<%--    }--%>
<%--</script>--%>

<script>
    layui.use(['form'], function(){
        form = layui.form;

    });




</script>
</body>
</html>
